-- crystal_bonus
-- create by zhuangsl
-- 下楼获得晶石

return {
    apply = function(prop, baseValue)
        return prop[3];
    end,

    -- 进入下一层触发
    trigger = function(who, prop, arg)
        -- 抽取一种结晶
        local count = prop[3];
        local rand  = DungeonM.getRandSeed("crystal_bonus");
        local arr = {};

        if tonumber(prop[2]) == 1 then
            arr = { 7042, 7043 };
        elseif tonumber(prop[2]) == 2 then
            arr = { 7017, 7018, 7019, 7020 };
        end

        local class_id = FormulaM.invoke("FETCH_BY_RAND", arr, rand);

        BonusM.doBonus({1, class_id, count}, "crystal_bonus");

        return true;
    end,

    record = function(target, prop, path)
        return false;
    end
};
